<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="renderer" content="webkit|ie-comp|ie-stand" />
		<meta name="wiewport" content="width=device-width, initial-scale=1.0, maxinum-scale=1.0, user-scaleable=no" />
		<title>企业联系人审核-管理后台</title>
        <script type="text/javascript" src="/js/userCommon.js"></script>
        <script type="text/javascript" src="/js/bootstrap-suggest.min.js"></script>
	</head>

	<body class="main_body">
		<!--头部nav-->
		<div class="navbar navbar-default">
			<div class="container">
				<ul class="nav text-center quick_enter">
					<li><img src="/img/logo_login_03.jpg" class="nav_img" /></li>
					<li class="quick_enterli m-l-md">
						<a href="/entry.html">首页 </a>
					</li>
					<li class="quick_enterli">
						<a href="/theme.html" class="">强链接企业</a>
					</li>
					<li class="quick_enterli">
						<a href="/partner.html" class="">战略合作伙伴</a>
					</li>
					<li class="quick_enterli">
						<a href="/data.html" class="">数据看板</a>
					</li>
					<li class="dropdown pull-right admin_info">
						<img src="/img/shejishi_07.jpg" class="img-photo" />
						<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
							<span id="user_span"></span> <span class="drop_caret"></span>
						</a>
						<ul class="dropdown-menu">
							<li>
								<a href="/usercenter/myAttention.html" ><i class="fa fa-user-secret"></i> 个人中心</a>
							</li>
							<li class="hidden" id="backPageEnter1">
								<a href="javascript:void(0)" ><i class="fa fa-server"></i> 后台管理</a>
							</li>
							<li>
								<a href="javascript:void(0)" id="logout_a"><i class="fa fa-sign-out"></i> 退出登录</a>
							</li>
						</ul>
					</li>
				</ul>
			</div>
		</div>
		<!--主体-->
		<div class="container containerbox">
			<!--左边导航-->
			<div class="left_side">
				<div class="ibox">
                    <h3 class="topTitle">账号管理</h3>
					<ul class="leftMeun">
                        <li>
							<a href="/admin/accountList.html"><i class="fa fa-weixin" aria-hidden="true"></i>账号列表</a>
						</li>
						<li>
							<a href="/admin/addAccount.html"><i class="fa fa-unlink" aria-hidden="true"></i>新增账号</a>
						</li>
					</ul>
					<h3 class="topTitle">审核管理</h3>
					<ul class="leftMeun">
                        <li  class="active">
							<a href="/admin/businessContactsExamine.html"><i class="fa fa-weixin" aria-hidden="true"></i>联系人审核</a>
                        </li>
                        <li class="">
							<a href="/admin/businessInteractionExamine.html"><i class="fa fa-weixin" aria-hidden="true"></i>链接互动审核</a>
                        </li>
                        <li class="">
							<a href="/admin/businessNeedExamine.html"><i class="fa fa-weixin" aria-hidden="true"></i>企业需求审核</a>
						</li>
						<li class="">
							<a href="/admin/businessList.html"><i class="fa fa-weixin" aria-hidden="true"></i>企业审核</a>
                        </li>
                        <li class="">
							<a href="/admin/partnerList.html"><i class="fa fa-weixin" aria-hidden="true"></i>合作伙伴审核</a>
						</li>
					</ul>
				</div>

			</div>
			<!--右边-->
			<div class="right_side">
				<div class="ibox">
					<div class="ibox-content" >
                        <div class="comform-inline">
							<label>状态：</label>
							<select id="dataType" style="width: 100px;">
								<option value="0" selected>全部</option>
								<option value="-1">未审核</option>
								<option value="1">已审核</option>
							</select>
                            <button type="button" id="searchBtn" class="btn">查询</button>
                            <!-- <button type="button" id="addBtn" class="btn" style="float:right">增加</button> -->
                        </div>
						<table class="table_at">
							<tr class="ac_title">
								<th style="width: 10%;">序号</th>
								<th style="width: 30%;">企业名称</th>
								<th style="width: 15%;">姓名</th>
								<th style="width: 15%;">职位</th>
								<th style="width: 15%;">状态</th>
								<th style="width: 15%;">操作</th>
							</tr>
							<tbody id="list">
			
							</tbody>
						</table>
						<!--分页-->
						<div class="pagination-box">
							<ul class="pagination">
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--footer-->
        <div class="footer" id="footerA"> </div>
        <!-- 查看模态框（Modal） -->
        <div class="modal fade" id="myModal0" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h4 class="modal-title" id="myModalLabel">企业联系人</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal" role="form" id="myModal1-body">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">企业名称</label>
                                <div class="col-sm-10">
                                  <input type="text" class="form-control" id="entname0" readonly>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">姓名</label>
                                <div class="col-sm-10">
                                  <input type="text" class="form-control" id="name0" readonly>
                                </div>
                              </div>
                              <div class="form-group">
                                <label class="col-sm-2 control-label">职位</label>
                                <div class="col-sm-10">
                                  <input type="text" class="form-control" id="position0" readonly>
                                </div>
                              </div>
                              <div class="form-group">
                                <label class="col-sm-2 control-label">联系方式</label>
                                <div class="col-sm-10">
                                  <input type="text" class="form-control" id="tel0" readonly>
                                </div>
                              </div>
                              <div class="form-group">
                                <label class="col-sm-2 control-label">创建人</label>
                                <div class="col-sm-10">
                                  <input type="text" class="form-control" id="createBy0" readonly>
                                </div>
                              </div>
                              <div class="form-group">
                                <label class="col-sm-2 control-label">修改人</label>
                                <div class="col-sm-10">
                                  <input type="text" class="form-control" id="updateBy0" readonly>
                                </div>
                              </div>
                              <div class="form-group">
                                <label class="col-sm-2 control-label">审核状态</label>
                                <div class="col-sm-10">
                                  <input type="text" class="form-control" id="labelVerify0" readonly>
                                </div>
                              </div>
                        </form>                          
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary btn-shenhe">审核</button>
                        <button type="button" class="btn btn-primary btn-delete">删除</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div>
        <!-- /.modal -->
		<!-- 增加模态框（Modal） -->
        <div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h4 class="modal-title" id="myModalLabel">企业联系人</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal" role="form" id="myModal1-body">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">企业名称</label>
                                <div class="col-sm-10 input-group" style="float: left;padding-left: 15px;padding-right: 15px;">
                                  <input type="text" class="form-control" id="entname1" placeholder="请输入企业名称（必填）">
                                  <div class="input-group-btn">
                                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" id="sdropdown" style="height: 30px;">
                                            <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="name1" class="col-sm-2 control-label">姓名</label>
                                <div class="col-sm-10">
                                  <input type="text" class="form-control" id="name1" placeholder="请输入联系人姓名（必填）">
                                </div>
                              </div>
                              <div class="form-group">
                                <label for="position1" class="col-sm-2 control-label">职位</label>
                                <div class="col-sm-10">
                                  <input type="text" class="form-control" id="position1" placeholder="请输入联系人职位">
                                </div>
                              </div>
                              <div class="form-group">
                                <label for="tel1" class="col-sm-2 control-label">联系方式</label>
                                <div class="col-sm-10">
                                  <input type="text" class="form-control" id="tel1" placeholder="请输入联系人手机/电话号码" onkeyup="value=value.replace(/[^\d\-\d]/g,'')" maxlength=20>
                                </div>
                              </div>
                        </form>                          
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary">增加</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div>
        <!-- /.modal -->
        <!-- 修改模态框（Modal2） -->
        <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h4 class="modal-title" id="myModalLabel">企业联系人</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal" role="form" id="myModal2-body">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">企业名称</label>
                                <div class="col-sm-10 input-group" style="float: left;padding-left: 15px;padding-right: 15px;">
                                  <input type="text" class="form-control" id="entname2" placeholder="请输入企业名称（必填）">
                                  <div class="input-group-btn">
                                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" id="sdropdown1" style="height: 30px;">
                                            <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                        </ul>
                                    </div>
                                </div>
                            </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">姓名</label>
                                    <div class="col-sm-10">
                                      <input type="text" class="form-control" id="name2" placeholder="请输入联系人姓名（必填）">
                                    </div>
                                  </div>
                                
                                  <div class="form-group">
                                    <label class="col-sm-2 control-label">职位</label>
                                    <div class="col-sm-10">
                                      <input type="text" class="form-control" id="position2" placeholder="请输入联系人职位">
                                    </div>
                                  </div>
                                  <div class="form-group">
                                    <label class="col-sm-2 control-label">联系方式</label>
                                    <div class="col-sm-10">
                                      <input type="text" class="form-control" id="tel2" placeholder="请输入联系人手机/电话号码" onkeyup="value=value.replace(/[^\d\-\d]/g,'')" maxlength=20>
                                    </div>
                                  </div>
                                  <div class="form-group">
                                    <label class="col-sm-2 control-label">创建人</label>
                                    <div class="col-sm-10">
                                      <input type="text" class="form-control" id="createBy2" readonly>
                                    </div>
                                  </div>
                                  <div class="form-group">
                                    <label class="col-sm-2 control-label">修改人</label>
                                    <div class="col-sm-10">
                                      <input type="text" class="form-control" id="updateBy2" readonly>
                                    </div>
                                  </div>
                                  <div class="form-group">
                                    <label class="col-sm-2 control-label">审核状态</label>
                                    <div class="col-sm-10">
                                      <input type="text" class="form-control" id="labelVerify2" readonly>
                                    </div>
                                  </div>
                        
                        </form>                          
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary">保存</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div>
        <!-- /.modal -->
		<script type="text/javascript">
			var pageNo = 1
            var pageSize = 12
            var nowIndex = -1
            // 当前操作类型
            var doType = ''
            // 当前列表数据
            var list = null
            // 当前选中的数据下标
            var nowId = -1
            var timeoutId = 0
			$(document).ready(function(){
				if($.cookie('AuthorizationAdmin')===null || localStorage.getItem('adminName') === null) {
					showErr("您处于未登录状态，请先登录", '1000000');
					return
				}
				$('#user_span').text(localStorage.getItem('realname') )
				loadResult()
                $('#searchBtn').click(function(){
                    loadResult()
                })

                // 企业名称输入框输入时定期查询
                $("#entname1").off('keyup').on('keyup', function (event) {
                    var val = $(this).val()
                    if (val !== '') {
                        clearTimeout(timeoutId)
                        timeoutId = setTimeout(function () {
                            $.ajax({
                                url: service_url + '/a/zhiku/zkLinkInteraction/findByNameLike?token='+$.cookie('AuthorizationAdmin')+'&entName='+encodeURIComponent(val),
                                type: 'GET',
                                xhrFields: {
                                    withCredentials: true
                                },
                                crossDomain: true,
                                contentType: 'application/json',
                                dataType: 'jsonp',
                                jsonpCallback:"success_jsonpCallback",  
                                processData: false, // 告诉jQuery不要去处理发送的数据
                                success: function(data) {
                                    if (data.status == '00') {
                                        var items = JSON.parse(data.data)
                                        var suggestData = {
                                            value: []
                                        }
                                        for (var i=0;i<items.length;i++){
                                            if (items[i].entName) {
                                                suggestData.value.push({
                                                    world: items[i].entName
                                                })
                                            }
                                        }
                                        $("#entname1").bsSuggest("destroy");
                                        $("#entname1").bsSuggest({
                                            allowNoKeyword: false,
                                            data: suggestData
                                        })
                                        if (suggestData.value.length > 0) $('#sdropdown').click()
                                    } else {
                                        showErr(data.msg)
                                    }
                                },
                                error: function(XMLHttpRequest, textStatus, errorThrown) {
                                    console.log(XMLHttpRequest, textStatus, errorThrown)
                                }
                            })
                        }, 1000);
                    }
                });
                $("#entname2").off('keyup').on('keyup', function (event) {
                    var val = $(this).val()
                    if (val !== '') {
                        clearTimeout(timeoutId)
                        timeoutId = setTimeout(function () {
                            $.ajax({
                                url: service_url + '/a/zhiku/zkLinkInteraction/findByNameLike?token='+$.cookie('AuthorizationAdmin')+'&entName='+encodeURIComponent(val),
                                type: 'GET',
                                xhrFields: {
                                    withCredentials: true
                                },
                                crossDomain: true,
                                contentType: 'application/json',
                                dataType: 'jsonp',
                                jsonpCallback:"success_jsonpCallback",  
                                processData: false, // 告诉jQuery不要去处理发送的数据
                                success: function(data) {
                                    if (data.status == '00') {
                                        var items = JSON.parse(data.data)
                                        var suggestData = {
                                            value: []
                                        }
                                        for (var i=0;i<items.length;i++){
                                            if (items[i].entName) {
                                                suggestData.value.push({
                                                    world: items[i].entName
                                                })
                                            }
                                        }
                                        $("#entname2").bsSuggest("destroy");
                                        $("#entname2").bsSuggest({
                                            allowNoKeyword: false,
                                            data: suggestData
                                        })
                                        if (suggestData.value.length > 0) $('#sdropdown1').click()
                                    } else {
                                        showErr(data.msg)
                                    }
                                },
                                error: function(XMLHttpRequest, textStatus, errorThrown) {
                                    console.log(XMLHttpRequest, textStatus, errorThrown)
                                }
                            })
                        }, 1000);
                    }
                });

                // 查看按钮
                $('#list').on('click', '.do-chakan', function(){
                    $('.btn-shenhe,.btn-delete').hide()
                    nowIndex = $(this).attr('add-index')
                    $('#entname0').val(list[nowIndex].entname || '')
                    $('#name0').val(list[nowIndex].name || '')
                    $('#position0').val(list[nowIndex].position || '')
                    $('#tel0').val(list[nowIndex].tel || '')
                    $('#createBy0').val(list[nowIndex].createBy || '')
                    $('#updateBy0').val(list[nowIndex].updateBy || '')
                    var labelVerifyStr = '未审核'
					if (list[nowIndex].labelVerify == 0) labelVerifyStr = '未提交'
					if (list[nowIndex].labelVerify == 1) labelVerifyStr = '已审核'
					$('#labelVerify0').val(labelVerifyStr)
                    $('#myModal0').modal('show');
                })
                // 审核按钮
                $('#list').on('click', '.do-shenhe', function(){
                    $('.btn-delete').hide()
                    $('.btn-shenhe').show()
                    nowIndex = $(this).attr('add-index')
                    $('#entname0').val(list[nowIndex].entname || '')
                    $('#name0').val(list[nowIndex].name || '')
                    $('#position0').val(list[nowIndex].position || '')
                    $('#tel0').val(list[nowIndex].tel || '')
                    $('#createBy0').val(list[nowIndex].createBy || '')
                    $('#updateBy0').val(list[nowIndex].updateBy || '')
                    var labelVerifyStr = '未审核'
					if (list[nowIndex].labelVerify == 0) labelVerifyStr = '未提交'
					if (list[nowIndex].labelVerify == 1) labelVerifyStr = '已审核'
					$('#labelVerify0').val(labelVerifyStr)
                    $('#myModal0').modal('show');
                })
                // 删除按钮
                $('#list').on('click', '.do-delete', function(){
                    $('.btn-shenhe').hide()
                    $('.btn-delete').show()
                    nowIndex = $(this).attr('add-index')
                    $('#entname0').val(list[nowIndex].entname || '')
                    $('#name0').val(list[nowIndex].name || '')
                    $('#position0').val(list[nowIndex].position || '')
                    $('#tel0').val(list[nowIndex].tel || '')
                    $('#createBy0').val(list[nowIndex].createBy || '')
                    $('#updateBy0').val(list[nowIndex].updateBy || '')
                    var labelVerifyStr = '未审核'
					if (list[nowIndex].labelVerify == 0) labelVerifyStr = '未提交'
					if (list[nowIndex].labelVerify == 1) labelVerifyStr = '已审核'
					$('#labelVerify0').val(labelVerifyStr)
                    $('#myModal0').modal('show');
                })
                 // 修改按钮
                 $('#list').on('click', '.do-edit', function(){
                    nowIndex = $(this).attr('add-index')
                    $('#entname2').val(list[nowIndex].entname || '')
                    $('#name2').val(list[nowIndex].name || '')
                    $('#position2').val(list[nowIndex].position || '')
                    $('#tel2').val(list[nowIndex].tel || '')
                    $('#createBy2').val(list[nowIndex].createBy || '')
                    $('#updateBy2').val(list[nowIndex].updateBy || '')
                    var labelVerifyStr = '未审核'
					if (list[nowIndex].labelVerify == 0) labelVerifyStr = '未提交'
					if (list[nowIndex].labelVerify == 1) labelVerifyStr = '已审核'
					$('#labelVerify2').val(labelVerifyStr)
                    $('#myModal2').modal('show');
                })
                // 增加按钮
                $('#addBtn').click(function(){
                    $('#entname1,#name1,#position1,#tel1').val('')
                    $('#myModal1').modal('show');
                })
                $('#myModal1 .btn-primary').click(function() {
                    var entname = $('#entname1').val()
                    var name = $('#name1').val()
                    var position = $('#position1').val()
                    var tel = $('#tel1').val()
                    var createBy = localStorage.getItem('realname') == '' ? localStorage.getItem('username') : localStorage.getItem('realname')
                    if (entname === '' || name === '') {
                        showErr("企业名称或姓名不能为空",)
                    } else {
                        var paramStr = 'entname='+encodeURIComponent(entname)+'&name=' + encodeURIComponent(name) + '&position=' + encodeURIComponent(position) +'&tel='+encodeURIComponent(tel)+'&createBy='+encodeURIComponent(createBy)+ '&token=' + $.cookie('AuthorizationAdmin')
                        $.ajax({
                            url: service_url + '/a/zhiku/zkContacts/save?' + paramStr,
                            type: 'GET',
                            xhrFields: {
                                withCredentials: true
                            },
                            crossDomain: true,
                            contentType: 'application/json',
                            dataType: 'jsonp',
                            jsonpCallback:"success_jsonpCallback",  
                            processData: false, // 告诉jQuery不要去处理发送的数据
                            success: function(data) {
                                if (data.status === '00') {
                                    top.alert("增加联系人成功",'','',{type: 'success'})
                                    $('#myModal1').modal('hide')
                                    loadResult()
                                } else {
                                    showErr(data.msg)
                                }   
                            },
                            error: function(XMLHttpRequest, textStatus, errorThrown) {
                                console.log(XMLHttpRequest, textStatus, errorThrown)
                            }
                        })
                    }
                })
            
                // 审核按钮
                $('.btn-shenhe').click(function(){
                    var id = list[nowIndex].id
                    $.ajax({
                        url: service_url + '/a/zhiku/zkContacts/verifyContacts?token=' + $.cookie('AuthorizationAdmin')+'&id='+id,
                        type: 'GET',
                        xhrFields: {
                            withCredentials: true
                        },
                        crossDomain: true,
                        contentType: 'application/json',
                        dataType: 'jsonp',
                        jsonpCallback:"success_jsonpCallback",  
                        processData: false, // 告诉jQuery不要去处理发送的数据
                        success: function(data) {
                            if (data.status === '00') {
                                $('#myModal0').modal('hide')
                                loadResult()
                                top.alert("审核成功",'','',{type: 'success'})
                            } else {
                                showErr(data.msg)
                            } 
                        },
                        error: function(XMLHttpRequest, textStatus, errorThrown) {
                            console.log(XMLHttpRequest, textStatus, errorThrown)
                        }
                    })
                })

                // 删除按钮
                $('.btn-delete').click(function(){
                    console.log(list[nowIndex])
                    var id = list[nowIndex].id
                    $.ajax({
                        url: service_url + '/a/zhiku/zkContacts/logicDelete?token=' + $.cookie('AuthorizationAdmin')+'&id='+id,
                        type: 'GET',
                        xhrFields: {
                            withCredentials: true
                        },
                        crossDomain: true,
                        contentType: 'application/json',
                        dataType: 'jsonp',
                        jsonpCallback:"success_jsonpCallback",  
                        processData: false, // 告诉jQuery不要去处理发送的数据
                        success: function(data) {
                            if (data.status === '00') {
                                $('#myModal0').modal('hide')
                                loadResult()
                                top.alert("删除成功",'','',{type: 'success'})
                            } else {
                                showErr(data.msg)
                            } 
                        },
                        error: function(XMLHttpRequest, textStatus, errorThrown) {
                            console.log(XMLHttpRequest, textStatus, errorThrown)
                        }
                    })
                })

                // 修改按钮
                
                $('#myModal2 .btn-primary').click(function() {
                    var id = list[nowIndex].id
                    var entname = $('#entname2').val()
                    var name = $('#name2').val()
                    var position = $('#position2').val()
                    var tel = $('#tel2').val()
                    var updateBy = localStorage.getItem('realname') == '' ? localStorage.getItem('username') : localStorage.getItem('realname')
                    if (entname === '' || name === '') {
                        showErr("企业名称或姓名不能为空",)
                    } else {
                        var paramStr = 'id='+id+'&entname='+encodeURIComponent(entname)+'&name=' + encodeURIComponent(name) + '&position=' + encodeURIComponent(position) +'&tel='+encodeURIComponent(tel)+'&updateBy='+encodeURIComponent(updateBy)+ '&token=' + $.cookie('AuthorizationAdmin')
                        $.ajax({
                            url: service_url + '/a/zhiku/zkContacts/updateContacts?' + paramStr,
                            type: 'GET',
                            xhrFields: {
                                withCredentials: true
                            },
                            crossDomain: true,
                            contentType: 'application/json',
                            dataType: 'jsonp',
                            jsonpCallback:"success_jsonpCallback",  
                            processData: false, // 告诉jQuery不要去处理发送的数据
                            success: function(data) {
                                if (data.status === '00') {
                                    top.alert("修改成功",'','',{type: 'success'})
                                    $('#myModal2').modal('hide')
                                    loadResult()
                                } else {
                                    showErr(data.msg)
                                }   
                            },
                            error: function(XMLHttpRequest, textStatus, errorThrown) {
                                console.log(XMLHttpRequest, textStatus, errorThrown)
                            }
                        })
                    }
                })
                  
            })
            // 根据条件查询
            function loadResult() {
                $('#list').empty()
                $('.pagination-box').hide()
                var labelVerify = $('#dataType').val()
                var paramStr = ''
                if (labelVerify == 0) {
                    paramStr = 'labelVerify=3&pageNo='+pageNo+'&pageSize='+pageSize+'&token=' + $.cookie('AuthorizationAdmin')
                } else {
                    paramStr = 'labelVerify='+labelVerify+'&pageNo='+pageNo+'&pageSize='+pageSize+'&token=' + $.cookie('AuthorizationAdmin')
                }
                $.ajax({
                    url: service_url + '/a/zhiku/zkContacts/findList?'+paramStr,
                    type: 'GET',
                    xhrFields: {
                        withCredentials: true
                    },
                    crossDomain: true,
                    contentType: 'application/json',
                    dataType: 'jsonp',
                    jsonpCallback:"success_jsonpCallback",  
                    processData: false, // 告诉jQuery不要去处理发送的数据
                    success: function(data) {
                        var data = JSON.parse(data.data)
                        if (data.count === 0) {
                            $('#list').append('<tr><td colspan="6" style="text-align:center">暂无数据</td></tr>')
                        } else {
                            list = data.list
                            var tempHtml = ''
                            for (var i = 0; i < list.length; i++) {
                                var name = list[i].name || ''
                                var position = list[i].position || ''
                                var statusHtml = ''
								var doHtml = ''
								if (list[i].labelVerify == -1) {
									statusHtml = '<span class="examine-no">未审核</span>'
									doHtml = '<span class="do-chakan" add-index="'+i+'">查看</span><span class="do-shenhe" add-index="'+i+'">审核</span><span class="do-edit" add-index="'+i+'">修改</span><span class="do-delete" add-index="'+i+'">删除</span>'
								} else if (list[i].labelVerify == 1) {
									statusHtml = '<span class="examine-yes">已审核</span>'
									doHtml = '<span class="do-chakan" add-index="'+i+'">查看</span><span class="do-edit" add-index="'+i+'">修改</span><span class="do-delete" add-index="'+i+'">删除</span>'
								} else if (list[i].labelVerify == 0) {
									statusHtml = '未提交'
								}


                                tempHtml = tempHtml + '<tr><td>'+((pageNo-1)*pageSize+i+1)+'</td><td>'+list[i].entname+'</td><td>'+name+'</td><td>'+position+'</td><td>'+statusHtml+'</td><td>'+doHtml+'</td></tr>'
                            }
                            $('#list').append(tempHtml)
                            $('.pagination-box').show()
                            $('.pagination').jqPaginator({
                                totalCounts: data.count,
                                pageSize: pageSize,
                                visiblePages: 10,
                                currentPage: pageNo,
                                first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
                                prev: '<li class="prev"><a href="javascript:void(0);">&laquo;<\/a><\/li>',
                                next: '<li class="next"><a href="javascript:void(0);">&raquo;<\/a><\/li>',
                                last: '<li class="last"><a href="javascript:void(0);">末页<\/a><\/li>',
                                page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
                                onPageChange: function (num, type) {
                                    if (type === 'change') {
                                        pageNo = num
                                        loadResult()
                                    }
                                }
                            });
                        }
                    },
                    error: function(XMLHttpRequest, textStatus, errorThrown) {
                        hideLoading()
                        console.log(XMLHttpRequest, textStatus, errorThrown)
                    }
                })
            }

		</script>
	</body>

</html>